package com.wiscamp.ninechapters.panels.domain.enums;

public enum ScopeTypes {
    None("无", 0),
    AllScope("全员数据范围", 109001),
    TeamScope("团队数据范围", 109002),
    PersonalScope("个人数据范围", 109003),
    Custom("定制数据范围", 109004);

    private String name;
    private int index;

    // 构造方法
    private ScopeTypes(String name, int index) {
        this.name = name;
        this.index = index;
    }

    // 普通方法
    public static String getName(int index) {
        for (ScopeTypes c : ScopeTypes.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }

    // get set 方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public long getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
